﻿<%@ Page Language="C#" MasterPageFile="~/car-insurance/Car_Insurance.master" AutoEventWireup="true"
    CodeFile="results-new.aspx.cs" Async="true" Inherits="car_insurance_results_new"
    EnableEventValidation="false" MaintainScrollPositionOnPostback="true" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<%@ Register Src="~/controls/usrNoJS.ascx" TagName="usrNoJS" TagPrefix="ucNoJS" %>
<%@ Register Src="~/controls/usrPhoneNo.ascx" TagName="usrPhoneNo" TagPrefix="uc1" %>
<%@ Register Src="~/controls/usrIdNumber.ascx" TagName="usrIdNumber" TagPrefix="uc2" %>
<%@ Register Src="~/controls/usrDate.ascx" TagName="usrDate" TagPrefix="uc3" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <asp:ScriptManager ID="ScriptManager" runat="server">
    </asp:ScriptManager>
    <link rel="stylesheet" type="text/css" href="../css/forms_results.css" />
    <link rel="stylesheet" type="text/css" href="../css/button.css" />
    <!--[if lte IE 6]>
        <link rel="stylesheet" type="text/css" href="/css/IE6.css" />
    <![endif]-->
    <!--[if lte IE 7]>
        <link rel="stylesheet" type="text/css" href="/css/IE7.css" />
    <![endif]-->
    <style type="text/css">
        .modalBackground
        {
            background-color: Gray;
            filter: alpha(opacity=90);
            opacity: 0.8;
        }
    </style>
    <div class="elements_inner_wrapper">
        <ucNoJS:usrNoJS ID="usrNoJS1" runat="server" />
        <!-- #Include file="../includes/body_loader.inc" -->

        <script type="text/javascript">
            IncreaseProgress(10);
        </script>

        <div id="divContent" style="display: none;">
            <div class="form_selection" id="divFormSelection" runat="server">
                <h3>
                    <asp:Label ID="lblProvider" runat="server"></asp:Label></h3>
                <div class="selection_wrap">
                    <span class="fs_lbl">Make\Model : </span>
                    <asp:Label ID="lblCarMakemodelTop" class="fs_lbl_m" runat="server" /><!--MERCEDES BENZ 190E</span>-->
                    <span class="fs_lbl_r">Year of Registration : </span>
                    <asp:Label ID="lblYrofRegisterTop" class="fs_lbl_m" runat="server" /><!--2009</span>-->
                    <span class="fs_lbl_r">Renewal NCD : </span>
                    <asp:Label ID="lblAppNCDvalueTop" class="fs_lbl_m" runat="server" /><!--10</span>-->
                    <span class="fs_lbl_r">Commencement Date : </span>
                    <asp:Label ID="lblCommencementdateTop" runat="server" /><!--18-October-2011</span>-->
                </div>
            </div>
            <div id="contentBody_full">
                <div style="text-align: left; display: block;" id="divCarMenu" runat="server">
                    <ul id="stp_menu">
                        <li class="stp1_r">
                            <asp:HyperLink ID="hplCarDetails" NavigateUrl="~/car-insurance/" runat="server"><span class="stp_r_g">Car Details</span></asp:HyperLink>
                        </li>
                        <li class="stp2_r">
                            <asp:HyperLink ID="hplProfile" NavigateUrl="#" runat="server"><span class="stp_r_g">Your Details</span></asp:HyperLink></li>
                        <li class="stp3_r">
                            <asp:HyperLink ID="hplCarResults" NavigateUrl="~/car-insurance/results-new.aspx"
                                runat="server"><span class="active_r">Compare & Buy Now</span></asp:HyperLink></li>
                        <%--<li class="stp4"><a href="#"><span class="stp_r">Buy Direct</span></a></li>--%>
                    </ul>
                    <div class="seperator">
                    </div>
                    <div class="clear">
                    </div>
                </div>
                <div class="section">
                    <fieldset>
                        <div class="form_subbox" id="divSummaryBox" runat="server" visible="false">
                            <div style="float: left; position: absolute; margin-left: 190px; width: 190px; height: 24px;
                                margin-top: 5px;">
                                <asp:Button ID="btnNewQuote" runat="server" OnClick="btnNewQuote_Click" CssClass="button_w_run-new-quotes" />
                                <%--  <asp:ImageButton ID="ibtRunNewQuote" AlternateText="Run New Quote" 
                                    OnClick="ibtRunNewQuote_Click" runat="server" />--%>
                            </div>
                            <div class="trigger open">
                                <a href="#">Open</a></div>
                            <div id="divQuoteSummery">
                                <div class="divhalf">
                                    <div class="row3">
                                        <label for="name">
                                            Year of Manufacture</label>
                                        <div class="field">
                                            <span class="indicator">
                                                <asp:Label ID="lblYrofManufacture" runat="server"></asp:Label>
                                            </span>
                                        </div>
                                        <div class="clear">
                                        </div>
                                    </div>
                                    <div class="row3">
                                        <label for="name">
                                            Year of Registration</label>
                                        <div class="field">
                                            <span class="indicator">
                                                <asp:Label ID="lblYrofRegister" runat="server"></asp:Label>
                                            </span>
                                        </div>
                                        <div class="clear">
                                        </div>
                                    </div>
                                    <div class="row3">
                                        <label for="name">
                                            Car Make & Model</label>
                                        <div class="field">
                                            <span class="indicator">
                                                <asp:Label ID="lblCarMakemodel" runat="server"></asp:Label>
                                            </span>
                                        </div>
                                        <div class="clear">
                                        </div>
                                    </div>
                                    <div class="row3">
                                        <label for="name">
                                            Offpeak Vehicle?</label>
                                        <div class="field">
                                            <span class="indicator">
                                                <asp:Label ID="lblOffpeakvehile" runat="server"></asp:Label>
                                            </span>
                                        </div>
                                        <div class="clear">
                                        </div>
                                    </div>
                                    <div class="row3">
                                        <label for="name">
                                            Current/Existing NCD</label>
                                        <div class="field">
                                            <span class="indicator">
                                                <asp:Label ID="lblNCDvalue" runat="server"></asp:Label>
                                            </span>
                                        </div>
                                        <div class="clear">
                                        </div>
                                    </div>
                                </div>
                                <div class="divhalf">
                                    <div class="row3">
                                        <label for="name">
                                            Applicable/Renewal NCD</label>
                                        <div class="field">
                                            <span class="indicator">
                                                <asp:Label ID="lblAppNCDvalue" runat="server"></asp:Label>
                                            </span>
                                        </div>
                                        <div class="clear">
                                        </div>
                                    </div>
                                    <div class="row3">
                                        <label for="name">
                                            Any Claims in the Last 3 Years?</label>
                                        <div class="field">
                                            <span class="indicator">
                                                <asp:Label ID="lblAnyclaim" runat="server"></asp:Label>
                                            </span>
                                        </div>
                                        <div class="clear">
                                        </div>
                                    </div>
                                    <div class="row3">
                                        <label for="name">
                                            Offence-Free Driving/COM</label>
                                        <div class="field">
                                            <span class="indicator">
                                                <asp:Label ID="lblOffenceDriving" runat="server"></asp:Label>
                                            </span>
                                        </div>
                                        <div class="clear">
                                        </div>
                                    </div>
                                    <div class="row3">
                                        <label for="name">
                                            Add Additional Name Driver</label>
                                        <div class="field">
                                            <span class="indicator">
                                                <asp:Label ID="lblAddDriver" runat="server"></asp:Label>
                                            </span>
                                            <div style="display: none;">
                                                <asp:TextBox ID="txtDriverCount" runat="server" Text="0"></asp:TextBox></div>
                                        </div>
                                        <div class="clear">
                                        </div>
                                    </div>
                                    <div class="row3">
                                        <label for="name">
                                            Cover Commencement Date</label>
                                        <div class="field">
                                            <span class="indicator">
                                                <asp:Label ID="lblCommencementdate" runat="server"></asp:Label>
                                            </span>
                                        </div>
                                        <div class="clear">
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <div class="clear">
                            </div>
                        </div>
                    </fieldset>
                    <div class="seperator">
                    </div>
                    <div class="clear">
                    </div>
                    <div id="divUserRefDetail" runat="server">
                        <!-- CALL ME | Start  -->
                        <div id="divNoMatchFound" runat="server" visible="false">
                            <b>No matches found!</b>
                            <p>
                                <asp:Label runat="server" ID="lblNoMatchText" Text="We can’t find you an online quote. Please check back again."></asp:Label>
                            </p>
                            <div class="seperator">
                            </div>
                            <div class="seperator">
                            </div>
                            <div class="seperator">
                            </div>
                            <div>
                                <br />
                                <br />
                                <br />
                                <br />
                                <br />
                                <br />
                                <br />
                                <br />
                                <br />
                                <br />
                                <br />
                                <br />
                                <asp:Button runat="server" ID="imgbtnBack" Visible="true" onmousedown="this.className = 'button_back_mousedown';"
                                    onmouseout="this.className = 'button_back';" onmouseup="this.className = 'button_back';"
                                    CssClass="button_back" CausesValidation="false" OnClientClick="this.removeAttribute('onmouseout');this.removeAttribute('onmouseup'); this.className = 'button_processing';"
                                    OnClick="imgbtnBack_Click" />
                            </div>
                        </div>
                        <!-- CALL ME | End    -->
                    </div>
                    <div style="width: 100%; height: auto; text-align: right; display: none;" id="divHeadingbuydirect"
                        runat="server">
                        <asp:Image ImageUrl="~/images/bg/heading_buydirect.png" runat="server" ID="imgInstantBuy" /></div>
                    <div>
                        <asp:ImageButton runat="server" ID="imgbtnCompare" ImageUrl="~/images/button/xl/select-compare_single.png"
                            OnClick="imgbtnCompare_Click" OnClientClick="return Validate_Checkbox()" />
                    </div>
                    <div class="seperator_hilite" id="imgdown" runat="server">
                    </div>
                    <asp:GridView ID="gvCarResult" runat="server" AutoGenerateColumns="False" CellPadding="0"
                        GridLines="None" DataKeyNames="CITempResultId,ProviderCompanyId" EmptyDataText="<div class='pad_10'><h2>No Matches Found!</h2><span class='font_12'><strong>Please take note that there are no matches found based on your details entered.</strong></span><div class='seperator'></div><div class='seperator'></div>You can also return to our <a href='/'>homepage</a> or our dedicated <a href='/car-insurance/'>car insurance</a> page to re-quote.<div class='seperator'></div>Thank you for using CompareXpress.com.</div>"
                        EmptyDataRowStyle-CssClass="" OnRowCreated="gvCarResult_RowCreated" OnRowCommand="gvCarResult_RowCommand"
                        AllowSorting="True" OnSorting="gvCarResult_Sorting" OnRowDataBound="gvCarResult_RowDataBound"
                        CssClass="table_results" ShowFooter="true">
                        <Columns>
                            <asp:BoundField DataField="CITempResultId" HeaderText="CITempResultId" Visible="false" />
                            <asp:BoundField DataField="CXCoverTypeId" HeaderText="CXCoverTypeId" Visible="false" />
                            <asp:BoundField DataField="ProviderCompanyId" HeaderText="ProviderCompanyId" Visible="false" />
                            <asp:TemplateField HeaderStyle-CssClass="colmargin" FooterStyle-CssClass="bg_white">
                                <ItemStyle CssClass="colchk" />
                                <ItemTemplate>
                                    <div onmouseover="this.className='colchk_selected'" onmouseout="this.className='colchk'"
                                        style="width: 100%; height: 100%; vertical-align: middle;" id="divcbCar" runat="server">
                                        <div class="pad50pxt">
                                            <asp:CheckBox ID="cbCarSelect" runat="server" onclick="if (this.checked) return checkMaxBox(this, id); else boxesChecked--;unCheckBox(id);  " /><asp:Label
                                                runat="server" ID="lblTempId" Visible="false"></asp:Label>
                                        </div>
                                    </div>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderStyle-CssClass="title_l" HeaderText="Insurer">
                                <ItemTemplate>
                                    <div>
                                        <asp:Image ID="imgCompanyLogo" runat="server" ImageUrl="~/images/public/logo/liberty.png"
                                            Width="100px" />
                                    </div>
                                    <div>
                                        <asp:Label ID="lblInsurerName" runat="server" Text="" />
                                    </div>
                                </ItemTemplate>
                                <ItemStyle CssClass="col_l border2pxl_grey border1pxb_grey" />
                            </asp:TemplateField>
                            <asp:BoundField DataField="AnnualPremium" DataFormatString="{0:c}" HtmlEncode="false"
                                HeaderText="Annual Premium" HeaderStyle-CssClass="title_price" ItemStyle-CssClass="colprice border1pxb_grey" />
                            <asp:TemplateField HeaderText="Learn more" HeaderStyle-CssClass="title_r">
                                <ItemTemplate>
                                    <asp:Button ID="btnLearnMore" runat="server" CommandName="LearnMore" class="button_learn-more"
                                        onmousedown="this.className = 'button_learn-more_mousedown';" onmouseup="this.className = 'button_learn-more';"
                                        onmouseout="this.className = 'button_learn-more';" />
                                </ItemTemplate>
                                <ItemStyle CssClass="col_r border2pxr_grey border1pxb_grey" />
                            </asp:TemplateField>
                        </Columns>
                        <PagerStyle />
                        <SelectedRowStyle />
                        <HeaderStyle CssClass="header" />
                        <EditRowStyle />
                        <RowStyle CssClass="row" />
                        <FooterStyle CssClass="row_last" />
                    </asp:GridView>
                    <div style="height: 150px" runat="server" id="divMessage" visible="false">
                        <asp:Label ID="lblMessage" Font-Size="20px" Font-Bold="true" runat="server" Visible="false"></asp:Label>
                    </div>
                    <asp:Label ID="lblRMessage" runat="server" Visible="false"></asp:Label>
                    <div id="imgup" runat="server">
                        <img src="/images/form/bg_result-header_colmargin_up.png" alt="" /></div>
                </div>
                <div>
                    <asp:ImageButton runat="server" ID="imgbtnCompare2" ImageUrl="~/images/button/xl/select-compare_single.png"
                        OnClick="imgbtnCompare_Click" OnClientClick="return Validate_Checkbox()" /></div>
                <div class="seperator">
                </div>
                <div class="seperator">
                </div>
                <div class="seperator_dashed">
                </div>
                <div class="seperator">
                </div>
                <div class="seperator">
                </div>
                <asp:Button runat="server" ID="btnBack" Visible="true" onmousedown="this.className = 'button_back_mousedown';"
                    onmouseup="this.className = 'button_back';" onmouseout="this.className = 'button_back';"
                    CssClass="button_back" CausesValidation="false" OnClientClick="this.removeAttribute('onmouseout'); this.removeAttribute('onmouseup'); this.className = 'button_processing';"
                    OnClick="btnBack_Click" />
                <div class="formButtons">
                    <div class="cancel">
                        <span class="button2"><span style="position: relative; left: 220px; display: none"><a
                            href="#" onclick="popup('popUpDiv')">
                            <img src="../images/buttons/butt_Compare.jpg" width="114" height="43" alt="Compare" /></a>
                        </span></span>
                    </div>
                    <div class="submit">
                    </div>
                    <div class="nextstep">
                        <span class="button2">
                            <asp:Button ID="btnNewCarInsurance" runat="server" OnClick="btnNewCarInsurance_Click"
                                Text="Start Over [New Car]" Visible="False" />
                        </span>
                    </div>
                </div>
                <div style="display: none;">
                    <asp:LinkButton runat="server" ID="lnkbtnPopup" Text="click"></asp:LinkButton>
                    <input id="inputProviderId" runat="server" type="hidden" />
                    <input id="inputCarResultId" runat="server" type="hidden" />
                    <input runat="server" id="inputCallMeMakeModel" type="hidden" />
                    <input runat="server" id="inputCallMeCompanyName" type="hidden" />
                    <input runat="server" id="inputEtiqaCallMeDone" type="hidden" value="0" />
                    <input runat="server" id="inputLibertyCallMeDone" type="hidden" value="0" />
                </div>
                <cc1:ModalPopupExtender ID="mpePopup" runat="server" DropShadow="true" PopupControlID="pnlPopup"
                    BackgroundCssClass="modalBackground" TargetControlID="lnkbtnPopup" CancelControlID="btnClose"
                    BehaviorID="mdlPopup">
                </cc1:ModalPopupExtender>
                <!-- Learn More Popup | Start -->
                <asp:Panel ID="pnlPopup" runat="server" Style="display: none; background: white;"
                    Width="595px" Height="410px">
                    <div id="divPopup" style="padding: 10px; padding-top: 0px; height: 400px;">
                        <div style="width: 100%; height: 30px; text-align: right; margin-top: 3px;">
                            <div class="bg_grey_5 pad7px txtright" style="width: 560px; text-align: right;">
                                <a href="#" name="ctl00$ContentPlaceHolder1$btnClose" onclick="HidePanel();" id="ctl00_ContentPlaceHolder1_btnClose">
                                    <img src="/images/spacer.gif" id="btnClose" border="0" class="button_close" width="75"
                                        height="30" alt="Close" /></a>
                            </div>
                        </div>
                        <div class="seperator_15px">
                        </div>
                        <div class="seperator_15px">
                        </div>
                        <table cellpadding="0" cellspacing="0" border="0" class="table_details" style="width: 580px;">
                            <tr>
                                <td width="220">
                                </td>
                                <td class="bg_grey_2" width="360">
                                    <div>
                                        <div class="curvetopleft left">
                                        </div>
                                        <div class="curvetopright right">
                                        </div>
                                    </div>
                                </td>
                            </tr>
                            <tr>
                                <td class="txtleft pad7px border1pxdotb_light">
                                    <strong>Your Full Name</strong>
                                </td>
                                <td class="bg_grey_2 pad7px border2pxdotb">
                                    <asp:TextBox ID="txtFullName" Width="250" MaxLength="80" runat="server" ReadOnly="true"></asp:TextBox>
                                </td>
                            </tr>
                            <tr>
                                <td class="txtleft pad7px border1pxdotb_light">
                                    <strong>Your E-mail</strong>
                                </td>
                                <td class="bg_grey_2 pad7px border2pxdotb">
                                    <asp:TextBox ID="txtEmail" runat="server" Width="250" MaxLength="100" ReadOnly="true"></asp:TextBox>
                                </td>
                            </tr>
                            <tr>
                                <td class="txtleft pad7px border1pxdotb_light">
                                    <strong>Your Mobile Number</strong>
                                </td>
                                <td class="bg_grey_2 pad7px border2pxdotb">
                                    <uc1:usrPhoneNo ID="txtMobileNo" IsEnabled="true" IsRequired="true" PhoneNoRequireErrorMessage="Require mobile number."
                                        PhoneNoErrorMessage="Mobile phone number should 8 digits." PhoneNoValidErrorMessage="Invalid mobile phone number."
                                        runat="server" ValidationGroup="requestoptions" IsReadOnly="true" />
                                </td>
                            </tr>
                            <tr id="trCallMeOption" style="display: none;">
                                <td class="txtleft pad7px border1pxdotb_light">
                                    <strong>Call Me Request</strong>
                                </td>
                                <td class="bg_grey_2 pad7px border2pxdotb">
                                        <div style="float:left; width:130px; padding-top:10px; text-align:right;">                                 
                                        <asp:DropDownList CssClass="blue" Font-Size="12px" runat="server" ID="ddlCallMeTime">
                                            <asp:ListItem Value="-1" Text="Select" />
                                            <asp:ListItem Value="1" Text="Morning" />
                                            <asp:ListItem Value="2" Text="Afternoon" />
                                            <asp:ListItem Value="3" Text="Evening" />
                                            <asp:ListItem Value="4" Text="AnyTime" />
                                        </asp:DropDownList>
                                        </div>
                                        <asp:Button runat="server" ID="btnCallMe" CssClass="button_call-me" OnClick="btnCallMe_Click"
                                            ValidationGroup="callme" OnClientClick="LoadValidationErrorCss(); return CallMeValidate(this);" />
                                        <asp:RequiredFieldValidator ID="rfvCallMeTime" runat="server" validationErrorCssClass="validationError"
                                            ValidationGroup="callme" ErrorMessage="" Text="" InitialValue="-1" ControlToValidate="ddlCallMeTime"></asp:RequiredFieldValidator>
                                </td>
                            </tr>
                            <tr>
                                <td class="txtleft pad7px">
                                    <strong>Your Preference</strong>
                                </td>
                                <td class="bg_grey_2 pad7px">
                                    <asp:Button runat="server" ID="btnBuyNow" CssClass="button_buy-now" OnClick="btnBuyNow_Click"
                                        OnClientClick="this.removeAttribute('onmouseout');this.removeAttribute('onmouseup'); this.className = 'button_processing';" />
                                </td>
                            </tr>
                            <%-- <tr id="trCallMeButton" style="display: none;">
                                <td class="txtleft pad7px border1pxdotb_light" valign="bottom">
                                    
                                </td>
                                <td class="bg_grey_2 pad7px border2pxdotb">
                                    <asp:Button runat="server" ID="btnCallMe" CssClass="button_call-me" OnClick="btnCallMe_Click"
                                        ValidationGroup="callme" OnClientClick="LoadValidationErrorCss(); return CallMeValidate(this);" />
                                </td>
                            </tr>--%>
                            <tr>
                                <td class="txtleft pad7px" valign="top">
                                    <div style="position: absolute">
                                        <asp:Image ID="imgProvider" runat="server" Width="145px" ImageUrl="~/images/public/logo/liberty.png" />
                                    </div>
                                </td>
                                <td class="bg_grey_2 pad7px">
                                    <asp:Button runat="server" ID="btnEmailMe" CssClass="button_email-me" OnClick="btnEmailMe_Click"
                                        OnClientClick="this.removeAttribute('onmouseout');this.removeAttribute('onmouseup'); this.className = 'button_processing';" />
                                    <asp:Button runat="server" ID="btnEmailThis" CssClass="button_forward-this" OnClick="btnEmailThis_Click"
                                        OnClientClick="this.removeAttribute('onmouseout');this.removeAttribute('onmouseup'); this.className = 'button_processing';" />
                                </td>
                            </tr>
                            <tr>
                                <td>
                                </td>
                                <td class="bg_grey_2 w210px">
                                    <div>
                                        <div class="curvebottomleft left">
                                        </div>
                                        <div class="curvebottomright right">
                                        </div>
                                    </div>
                                </td>
                            </tr>
                        </table>
                    </div>
                </asp:Panel>
                <!-- Learn More Popup | End   -->
            </div>
        </div>
    </div>

    <script type="text/javascript">
        IncreaseProgress(50);
    </script>

    </div>
    <div id="blanket" style="display: none;">
    </div>


    <script type="text/javascript">
        IncreaseProgress(75);
    </script>

    <script type="text/javascript">
        IncreaseProgress(95);
    </script>

    <script type="text/javascript">
        //AddMoreInfoRows();
        function ShowHideDiv(divName, varOnOff) {
            if (varOnOff) {
                document.getElementById(divName).style.display = "";
            }
            else {
                document.getElementById(divName).style.display = "none";
            }
        }
        function showhide(divName) {

            el = document.getElementById(divName);
            el.style.display = (el.style.display == "none") ? "" : "none";

        }
    </script>

    <script type='text/javascript'>
        window.onload = function() {

            var frm = document.forms[0];

            for (i = 0; i < frm.elements.length; i++) {
                if (frm.elements[i].type == "checkbox") {
                    frm.elements[i].checked = false;
                }
            }

        }

        function Validate_Checkbox() {
            var minCheck = 2;
            var NoOfChecks = 0;
            var chks = document.getElementsByTagName('input');
            //var hasChecked = false;
            for (var i = 0; i < chks.length; i++) {
                if (chks[i].checked) {
                    //hasChecked = true;
                    //break;
                    NoOfChecks++
                }
            }

            //alert(NoOfChecks);
            if (NoOfChecks < minCheck) {

                alert("Please select at least two");

                return false;
            }

        }

        var maxBoxes = 4;
        var boxesChecked = 0;

        function checkMaxBox(theBox, id) {

            if (boxesChecked + 1 > maxBoxes) {
                alert("please select max 4 plans");
                return false;
            }
            boxesChecked++
            if (document.getElementById(id).checked == true) {
                var prefid = id.replace(/cbCarSelect/, "");
                document.getElementById(prefid + 'divcbCar').className = 'colchk_checked';
                document.getElementById(prefid + 'divcbCar').onmouseover = '';
                document.getElementById(prefid + 'divcbCar').onmouseout = '';

            }
            return true;
        }

        function unCheckBox(id) {

            var prefid = id.replace(/cbCarSelect/, "");

            document.getElementById(prefid + 'divcbCar').className = '';
            document.getElementById(prefid + 'divcbCar').onmouseover = function onmouseover(event) { this.className = "colchk_selected"; }
            document.getElementById(prefid + 'divcbCar').onmouseout = function onmouseover(event) { this.className = "colchk"; }

        }


        function HidePanel() {
            document.getElementById('<%=pnlPopup.ClientID%>').style.display = 'none';
        }

        function ShowPopup(_companyId, _carResultId, _companyName) {

            document.getElementById('<%=inputProviderId.ClientID%>').value = _companyId;
            document.getElementById('<%=inputCarResultId.ClientID%>').value = _carResultId;
            document.getElementById('<%=inputCallMeCompanyName.ClientID%>').value = _companyName;

            imgurl = '';

            document.getElementById('divPopup').style.height = '410px';
            document.getElementById('<%=pnlPopup.ClientID%>').style.height = '400px';

            if (_companyId == '23') {
                imgurl = '/images/public/logo/hsbc.png';
                //document.getElementById('trCallMeButton').style.display = 'none';
                document.getElementById('trCallMeOption').style.display = 'none';

                document.getElementById('divPopup').style.height = '325px';
                document.getElementById('<%=pnlPopup.ClientID%>').style.height = '335px';
            }
            else if (_companyId == '29') {
                imgurl = '/images/public/logo/liberty.png';
                //document.getElementById('trCallMeButton').style.display = '';
                document.getElementById('trCallMeOption').style.display = '';


            }
            else {
                imgurl = '/images/public/logo/etiqa.png';
                //document.getElementById('trCallMeButton').style.display = '';
                document.getElementById('trCallMeOption').style.display = '';
            }

            document.getElementById('<%=imgProvider.ClientID%>').src = imgurl;

            var modpop = $find("mdlPopup");
            if (!modpop) { return; }
            modpop.show();
        }

        function LibertyCallMeDone() {
            alert('You have already requested for Liberty Insurance to call you. Please wait a while to get call from them. Thank you.');
        }

        function EtiqaCallMeDone() {
            alert('You have already requested for Etiqa Insurance to call you. Please wait a while to get call from them. Thank you.');
        }

        function CallMeValidate(thisbtn) {
            if (Page_ClientValidate('callme')) {

                if (document.getElementById('<%=inputProviderId.ClientID%>').value == "29") {
                    if (document.getElementById('<%=inputLibertyCallMeDone.ClientID%>').value == "1") {
                        LibertyCallMeDone();
                        return false;
                    }

                }

                if (document.getElementById('<%=inputProviderId.ClientID%>').value == "30") {
                    if (document.getElementById('<%=inputEtiqaCallMeDone.ClientID%>').value == "1") {
                        EtiqaCallMeDone();
                        return false;
                    }

                }

                thisbtn.className = 'button_processing';
            };
        }

        function ShowHideCallMe() {
            document.getElementById('divCallme').style.display = 'none';
        }




        IncreaseProgress(100);
        HideLoading();
        
    </script>

    <script src="../includes/carinsurance/results.js" type="text/javascript"></script>

</asp:Content>
